package com.example.springbootdemo.bean;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class LifeCycleBean {
  public LifeCycleBean(){
    log.debug("constructor");
  }

  @Autowired
  public void autoWrie(@Value("${JAVA_HOME}") String home){
    log.debug("autoWried, {}",home);
  }

  @PostConstruct
  public void init(){
    log.debug("post construct");
  }

  @PreDestroy
  public void destroy(){
    log.debug("destroy");
  }
}
